package cn.itsource.controller.html;

import cn.itsource.domain.html.NumberOfArticlesByCategory;
import cn.itsource.service.BlogArticleTypeService;
import cn.itsource.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController //@Contorller和@ResponseBody（所有的方法都返回json格式）
@RequestMapping("/html/blogArticleType") //公共路径
public class HtmlBlogArticleTypeController {
    @Autowired
    private BlogArticleTypeService service;
//    文章分类与数量
    @GetMapping("/selectArticleTypeStatistics")
    public AjaxResult pageList() {
      List<NumberOfArticlesByCategory> list = service.selectArticleTypeStatistics();
      return AjaxResult.Success(list);
    }
}
